
//页面跳转
$('.container').on('click','.kesn_to',function(){
	var _this = $(this);
	var _id = _this.attr('data-id');
	var _url = _this.attr('data-url');
	if ($.inArray(_id,parent.tabpanel_ids) != -1) {
			return;
	}
	var this_title = _this.attr('data-title');
	var title_html = ' <li role="presentation" class="active"><a href="#'+_id+'" aria-controls="'+_id+'" role="tab" data-toggle="tab">'+this_title+'&nbsp;&nbsp;&nbsp;<span class="fui-cross close kesnClose"></span></a></il>';
	var tab_html = '<div role="tabpanel" class="tab-pane active" id="'+_id+'"><iframe src="'+_url+'" frameborder="0" class="col-md-12" style="min-height:1000px;"></iframe></div>';
	$("li[role='presentation']",parent.document).each(function(){
		$(this).removeClass('active');
	});
	$("div[role='tabpanel']",parent.document).each(function(){
		$(this).removeClass('active');
	});
	$('.index_header',parent.document).find('.nav').append(title_html);
	$('.index_main',parent.document).find('.tab-content').append(tab_html);
	parent.tabpanel_ids.push(_id);
	parent.loginLosetime();
});
//21232f297a57a5a743894a0e4a801fc3
//提示框 success:成功；fail:失败
	function kesn_prompt(type,message,_function = function(){}){
		type = $.trim(type);
		var _type = '';
		if(type == 'success'){
			_type = 'alert-success';
		}else if(type == 'fail'){
			_type = 'alert-danger';
		}
		var _kesn_prompt = $(".kesn_prompt");
		if (_kesn_prompt.hasClass('alert-success')) {
			_kesn_prompt.removeClass('alert-success');
		}
		if (_kesn_prompt.hasClass('alert-danger')) {
			_kesn_prompt.removeClass('alert-danger');
		}
		_kesn_prompt.addClass(_type);
		_kesn_prompt.text(message);
		_kesn_prompt.fadeToggle(4000,_function);
	}

	//删除条目
	function kesn_del(id,url,con_message,own){
		var con = confirm(con_message);
		if (con == false) {
			return;
		}
		$.ajax({
			url : url,
			async:true,
			type:'POST',
			data:{
				'id' :id
			},
			dataType:'JSON',
			success:function(data,textStatus,jqXHR){
    				if (data.err != 0) {
    					kesn_prompt('fail',data.content);
    				}else if (data.err == 0) {
                        kesn_prompt('success','删除成功！',function(){
                        	own.parents('._item').remove();
                        	// window.location.reload();
                        });
                        
                    }

    			},
    			error:function(){
    				kesn_prompt('fail','网络出错');
    			}
		});
	}

	
